MINOR := 0
LIB_NAME := libxutil
LIB := $(LIB_NAME).so
-LIB += $(LIB_NAME).so.$(MAJOR)
-LIB += $(LIB_NAME).so.$(MAJOR).$(MINOR)
all: check-for-zlib $(LIB)
-$(LIB_NAME).so:
- ln -sf $(LIB_NAME).so.$(MAJOR) $@
+$(LIB_NAME).so: $(LIB_NAME).so.$(MAJOR)
+ ln -sf $^ $@
-$(LIB_NAME).so.$(MAJOR):
- ln -sf $(LIB_NAME).so.$(MAJOR).$(MINOR) $@
+$(LIB_NAME).so.$(MAJOR): $(LIB_NAME).so.$(MAJOR).$(MINOR)
+ ln -sf $^ $@
$(LIB_NAME).so.$(MAJOR).$(MINOR): $(LIB_OBJS)
$(CC) -Wl,-soname -Wl,$(LIB_NAME).so.$(MAJOR) -shared -o $@ $^
install -m0755 $(LIB) $(prefix)/usr/lib
clean:
- $(RM) *.a *.so *.o *.rpm $(LIB)
+ $(RM) *.a *.so *.so.* *.o *.rpm
$(RM) *~
$(RM) $(DEPS)
*/
int xfr_save(Args *args, XfrState *state, Conn *xend, char *file){
int err = 0;
- int flags = (O_CREAT | O_EXCL | O_WRONLY);
- int mode = 0644;
- int fd;
+ int compress = 0;
IOStream *io = NULL;
dprintf("> file=%s\n", file);
- fd = open(file, flags, mode);
- if(fd < 0) {
- eprintf("> Failed to open %s\n", file);
- err = -EIO;
- goto exit;
+ if(compress){
+ io = gzip_stream_fopen(file, "wb1");
+ } else {
+ io = file_stream_fopen(file, "wb");
}
- io = gzip_stream_fdopen(fd, "wb1");
if(!io){
- eprintf("> Failed to allocate gzip state for %s\n", file);
- err = -ENOMEM;
+ eprintf("> Failed to open %s\n", file);
+ err = -EINVAL;
goto exit;
}
err = xen_domain_snd(xend, io, state->vmid, state->vmconfig, state->vmconfig_n);